let yesOrNoDic = [
	{ label: '否', value: 0, type: 'danger' },
	{ label: '是', value: 1, type: 'success' },
]
let answerType = [
	{ label: '单选', value: 1 },
	{ label: '多选', value: 2 },
	{ label: '文本', value: 3 },
	{ label: '表格', value: 4 },
	{ label: '填空', value: 5 },
	{ label: '图片文件上传', value: 6 },
]
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{
			label: '标题',
			prop: 'itemTitle',
		},
		{
			label: '回答类型',
			prop: 'itemType',
			custome: 'tag',
			dicData: answerType,
		},
		{
			label: '是否开启',
			prop: 'itemEnable',
			custome: 'tag',
			dicData: yesOrNoDic,
		},
		{
			label: '是否必填',
			prop: 'requireFlag',
			custome: 'tag',
			dicData: yesOrNoDic,
		},
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}
export const itemData = {
	inline: false,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '填空内容',
			prop: 'optionContent',
			span: 24,
		},
		{
			label: '答案',
			prop: 'parentData',
			type: 'dynamic',
			span:24,
			width: 500,
			column:[
				{
					label: '内容(选项或表头)',
					prop: 'optionContent',
					width: 300,
				},
				{
					label: '分数',
					prop: 'optionScore',
					width: 300,
				},
				{
					label: '排序',
					prop: 'sortBy',
					width: 300,
				},
				{
					label: '特殊字符替换',
					prop: 'specialFlag',
					width: 300,
				},
				{
					label: '子类',
					prop: 'childData',
					type: 'dynamic',
					width: 1200,
					column: [
						{
							label: '内容(选项或表头)',
							prop: 'optionContent',
							width: 300,
						},
						{
							label: '分数',
							prop: 'optionScore',
							width: 300,
						},
						{
							label: '排序',
							prop: 'sortBy',
							width: 300,
						},
						{
							label: '特殊字符替换',
							prop: 'specialFlag',
							width: 300,
						},
					],
				},
			]
		},
		
	]
}
export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{ label: '标题', prop: 'itemTitle', span: 8 },
		// { 
		// 	label: '动态大类',
		// 	prop: 'tableId',
		// 	type:'remoteSelect',
		// 	api:'view_bscAssessTableInfo_list',
		// 	filterLabel:'tableTitle',
		// 	filterKey:'id',
		// 	multiple:false,
		// 	span: 8 
		// },
		{
			label: '是否启用',
			prop: 'itemEnable',
			type: 'radio',
			defaultValue:0,
			dicData: yesOrNoDic,
			span: 8,
		},
		{
			label: '是否必填',
			prop: 'requireFlag',
			type: 'radio',
			defaultValue:0,
			dicData: yesOrNoDic,
			span: 8,
		},
		{
			label: '回答类型',
			prop: 'itemType',
			type: 'radio',
			dicData: answerType,
			span: 8,
			defaultValue:1,
			control:(e,model)=>{
				console.log('控制',e)
				return {
					lineNumber: {
						display: e == 4,
					},
				}
			}
		},
		{ label: '排序', prop: 'sortBy', span: 8 },
		{
			label: '简介',
			prop: 'itemDescribe',
			type: 'textarea',
			span: 8,
		},
		{
			label: '表格行数',
			prop: 'lineNumber',
			span: 8,
		},
	],
}
const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '标题',
			prop: 'itemTitle',
			type: 'input',
			span: 8,
		},
		{ 
			label: '回答类型',
			prop: 'itemType',
			type:'select',
			dicData:answerType,
			multiple:false,
			span: 8 
		},
		{
			label: '是否必填',
			prop: 'requireFlag',
			type: 'select',
			dicData: yesOrNoDic,
			span: 8,
		},
	],
}

export const baseConfig: any = {
	pageName: '项目管理',
	addLabel: '添加',
	dictcodes: [],
	rowKey: 'id',
	tipLabel: 'itemTitle',
	api: {
		index: 'view_bscAssessTableItem_page',
		detail:'view_bscAssessTableItem_view',
		add: 'view_bscAssessTableItem_add',
		edit: 'view_bscAssessTableItem_edit',
		delete: 'view_bscAssessTableItem_del',
	},
	auth: {
		index: 'view_bscAssessTableItem_page',
		detail:'view_bscAssessTableItem_view',
		add: 'view_bscAssessTableItem_add',
		edit: 'view_bscAssessTableItem_edit',
		delete: 'view_bscAssessTableItem_del',
	},

	menuBtn: [
		{
			icon: 'editor',
			label: '编辑',
			type: 'primary',
			operate: 'edit',
			auth: 'view_dataManagementSettings_edit',
			text: true,
			show: true,
		},
		{
			icon: 'detail',
			label: '查看子项',
			type: 'primary',
			operate: 'viewItem',
			auth: '',
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			type: 'danger',
			operate: 'delete',
			auth: '',
			text: true,
			show: true,
		},
	],
	formConfig,
	dialogConfig: {
		width: '65%',
	},
	searchConfig,
	tableConfig
}
